/**
 * Copyright (C) 2018-2020
 * All rights reserved, Designed By www.yixiang.co
 * 注意：
 * 本软件为www.yixiang.co开发研制
 */
package co.yixiang.modules.shop.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author hupeng
 * @date 2020-05-12
 */

@Data
@TableName("yx_store_cart")
public class YxStoreCart extends BaseDomain {

    /**
     * 购物车表ID
     */
    @ApiModelProperty(value = "购物车表ID")
    @TableId
    private Long id;


    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @NotNull
    private Long uid;


    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    @NotNull
    private String type;


    /**
     * 商品ID
     */
    @ApiModelProperty(value = "商品ID")
    @NotNull
    private Long productId;

    /**
     * 商品SKU ID
     */
    @ApiModelProperty(value = "商品SKU ID")
    @NotNull
    private Long skuId;


    /**
     * 商品属性
     */
    @ApiModelProperty(value = "商品属性")
    @NotNull
    private String productAttrUnique;


    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    @NotNull
    private Integer cartNum;


    /**
     * 0 = 未购买 1 = 已购买
     */
    @ApiModelProperty(value = "0 = 未购买 1 = 已购买")
    @NotNull
    private Integer isPay;


    /**
     * 是否立刻购买
     */
    @Deprecated
    @ApiModelProperty(value = "是否立刻购买 0不是 1是",hidden = true)
    private Integer isNew;


    /**
     * 拼团id
     */
    @ApiModelProperty(value = "拼团id")
    private Long combinationId;


    /**
     * 秒杀产品ID
     */
    @ApiModelProperty(value = "秒杀产品ID")
    private Long seckillId;


    /**
     * 砍价id
     */
    @ApiModelProperty(value = "砍价id")
    private Long bargainId;

    /*门店ID*/
    @ApiModelProperty(value = "门店ID")
    @NotNull
    private Long storeId;


    public void copy(YxStoreCart source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
